home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
gnu
/
amiga
/
gccbsrld.lha
/
gcc-2.1.baserel.diff
next >
Wrap
Text File
|
1992-06-23
|
25KB
|
785 lines
diff -2rcN dh5:gcc-2.1.orig/config/amiga.c gcc-2.1/config/amiga.c
*** dh5:gcc-2.1.orig/config/amiga.c
--- gcc-2.1/config/amiga.c Sat Apr 18 22:37:16 1992
***************
*** 0 ****
--- 1,127 ----
+ /* amiga.c: Functions for Amiga as target machine for GNU C compiler */
+
+ /* NOTE: ATTRIBUTE STUFF IS NOT WORKING CURRENTLY !!!!! */
+
+ #include "m68k.c"
+ #include "tree.h"
+
+ struct attribute {
+ tree ident;
+ int saveds : 1,
+ interrupt : 1;
+ };
+
+
+ static struct attribute *a_tab = 0;
+ static int a_index, a_size;
+
+ void
+ add_attr_entry (attr)
+ struct attribute *attr;
+ {
+ if (! a_tab)
+ {
+ a_size = 10;
+ a_index = 0;
+ a_tab = (struct attribute *) xmalloc (a_size * sizeof (struct attribute));
+ }
+
+ if (a_index == a_size)
+ {
+ a_size <<= 1;
+ a_tab = (struct attribute *) xrealloc (a_tab, a_size * sizeof (struct attribute));
+ }
+
+ a_tab[a_index++] = *attr;
+ }
+
+
+ void
+ attr_do_saveds (function_ident)
+ tree function_ident;
+ {
+ struct attribute attr, *a;
+ int i;
+
+ for (i = 0, a = a_tab; i < a_index; i++, a++)
+ if (a->ident == function_ident)
+ {
+ a->saveds = 1;
+ return;
+ }
+
+ /* create a new entry for this function */
+ attr.ident = function_ident;
+ attr.saveds = 1;
+ attr.interrupt = 0;
+ add_attr_entry (&attr);
+ }
+
+ void
+ attr_do_interrupt (function_ident)
+ tree function_ident;
+ {
+ struct attribute attr, *a;
+ int i;
+
+ for (i = 0, a = a_tab; i < a_index; i++, a++)
+ if (a->ident == function_ident)
+ {
+ /* __interrupt implies __saveds */
+ a->saveds = 1;
+ a->interrupt = 1;
+ return;
+ }
+
+ /* create a new entry for this function */
+ attr.ident = function_ident;
+ attr.saveds = 1;
+ attr.interrupt = 1;
+ add_attr_entry (&attr);
+ }
+
+ int
+ attr_does_saveds (function_name)
+ char *function_name;
+ {
+ tree ident = get_identifier (function_name);
+ struct attribute *attr;
+ int i;
+
+ for (i = 0, attr = a_tab; i < a_index; i++, attr++)
+ if (attr->ident == ident)
+ return attr->saveds;
+
+ return 0;
+ }
+
+ int
+ attr_does_interrupt (function_name)
+ char *function_name;
+ {
+ tree ident = get_identifier (function_name);
+ struct attribute *attr;
+ int i;
+
+ for (i = 0, attr = a_tab; i < a_index; i++, attr++)
+ if (attr->ident == ident)
+ return attr->interrupt;
+
+ return 0;
+ }
+
+
+
+ /* Does operand (which is a symbolic_operand) live in text space? If
+ so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
+
+ int
+ read_only_operand (operand)
+ rtx operand;
+ {
+ if (GET_CODE (operand) == CONST)
+ operand = XEXP (XEXP (operand, 0), 0);
+ if (GET_CODE (operand) == SYMBOL_REF)
+ return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
+ return 1;
+ }
diff -2rcN dh5:gcc-2.1.orig/config/amiga.h gcc-2.1/config/amiga.h
*** dh5:gcc-2.1.orig/config/amiga.h
--- gcc-2.1/config/amiga.h Sat Apr 18 23:16:53 1992
***************
*** 0 ****
--- 1,398 ----
+ /* Definitions of target machine for GNU compiler. amiga 68000/68020 version.
+ Copyright (C) 1987, 1988 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+ /* This comment is here to see if it will keep amiga's cpp from dying. */
+
+ #include "m68k.h"
+
+ /* See tm-m68k.h. 7 means 68020 with 68881. */
+
+ #ifndef TARGET_DEFAULT
+ #define TARGET_DEFAULT 0
+ #endif
+
+ /* Define __HAVE_FPA__ or __HAVE_68881__ in preprocessor,
+ according to the -m flags.
+ This will control the use of inline 68881 insns in certain macros.
+ Also inform the program which CPU this is for. */
+
+ #if TARGET_DEFAULT & 02
+
+ /* -m68881 is the default */
+ #define CPP_SPEC \
+ "%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}\
+ %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
+
+ #else
+
+ /* -msoft-float is the default, assume -mc68000 as well */
+ #define CPP_SPEC \
+ "%{m68881:-D__HAVE_68881__ }\
+ %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}"
+
+ #endif
+
+ /* These compiler options take an argument. We ignore -target for now. */
+
+ /* #define WORD_SWITCH_TAKES_ARG(STR) (!strcmp (STR, "target")) */
+
+ /* -m68000 requires special flags to the assembler. */
+
+ #if TARGET_DEFAULT & 01
+
+ #define ASM_SPEC \
+ "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}} %{msmall-code:-l} "
+
+ #else
+
+ #define ASM_SPEC \
+ "%{m68020:-mc68020}%{mc68020:-mc68020}%{!mc68020:%{!m68020:-mc68010}} %{msmall-code:-l} "
+
+ #endif
+
+ /* amiga/amigados are the new "standard" defines for the Amiga, MCH_AMIGA
+ * was used before and is included for compatibility reasons */
+
+ #define CPP_PREDEFINES "-Dmc68000 -Damiga -Damigados -DMCH_AMIGA -DAMIGA"
+
+ /* STARTFILE_SPEC to include amiga floating point initialization
+ This is necessary (tr: amiga does it) for both the m68881 and the fpa
+ routines.
+ Note that includes knowledge of the default specs for gcc, ie. no
+ args translates to the same effect as -m68881
+ I'm not sure what would happen below if people gave contradictory
+ arguments (eg. -msoft-float -mfpa) */
+
+ /* for now, we only have a single set of crt0.o, this could change in
+ the future. */
+ #define STARTFILE_SPEC \
+ "%{resident:rcrt0.o%s}%{!resident:%{!fbaserel:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}%{fbaserel:%{pg:bgcrt0.o%s}%{!pg:%{p:bmcrt0.o%s}%{!p:bcrt0.o%s}}}}"
+
+
+ /* Specify library to handle `-a' basic block profiling.
+ Control choice of libm.a (if user says -lm)
+ based on fp arith default and options. */
+
+ /* for now, no different math libraries exist, there probably *will*
+ * be some in the future. */
+ #define LIB_SPEC "%{g:-lg} %{resident:-lbc}%{!resident:%{fbaserel:%{!p:%{!pg:-lbc}}%{p:-lbc_p}%{pg:-lbc_p}}%{!fbaserel:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}}"
+
+ /* if debugging, tell the linker to output amiga-hunk symbols *and*
+ * a BSD compatible debug hunk */
+
+ #define LINK_SPEC "%{g:-amiga-debug-hunk} %{fbaserel:-databss-together} %{resident:-databss-together} "
+
+ #define CC1_SPEC "%{resident:-fbaserel} "
+
+ #define CC1PLUS_SPEC "%{resident:-fbaserel} "
+
+ /* Omit frame pointer at high optimization levels. */
+
+ #define OPTIMIZATION_OPTIONS(OPTIMIZE) \
+ { \
+ if (OPTIMIZE >= 2) \
+ flag_omit_frame_pointer = 1; \
+ }
+
+ /* provide a dummy entry for the small-code switch. This is currently only
+ needed by the assembler (explanations: m68k.h) */
+
+ #undef TARGET_SWITCHES
+ #define TARGET_SWITCHES \
+ { { "68020", 5}, \
+ { "c68020", 5}, \
+ { "68881", 2}, \
+ { "bitfield", 4}, \
+ { "68000", -5}, \
+ { "c68000", -5}, \
+ { "soft-float", -0102}, \
+ { "nobitfield", -4}, \
+ { "rtd", 8}, \
+ { "nortd", -8}, \
+ { "short", 040}, \
+ { "noshort", -040}, \
+ { "fpa", 0100}, \
+ { "nofpa", -0100}, \
+ { "sky", 0200}, \
+ { "nosky", -0200}, \
+ { "68040", 0407}, \
+ { "68030", -01400}, \
+ { "68030", 7}, \
+ { "68040-only", 01000}, \
+ { "small-code", 0 }, \
+ { "", TARGET_DEFAULT}}
+
+ /* Every structure or union's size must be a multiple of 2 bytes. */
+
+ #define STRUCTURE_SIZE_BOUNDARY 16
+
+ /* This is BSD, so it wants DBX format. */
+
+ #define DBX_DEBUGGING_INFO
+
+ /* Allow folding division by zero. */
+ #define REAL_INFINITY
+
+ /* This is how to output an assembler line defining a `double' constant. */
+
+ #undef ASM_OUTPUT_DOUBLE
+ #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
+ { \
+ if (REAL_VALUE_ISINF (VALUE)) \
+ fprintf (FILE, "\t.double 0r%s99e999\n", (VALUE) > 0 ? "" : "-"); \
+ else if (isnan (VALUE)) \
+ { \
+ union { double d; long l[2];} t; \
+ t.d = (VALUE); \
+ fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", t.l[0], t.l[1]); \
+ } \
+ else \
+ fprintf (FILE, "\t.double 0r%.17g\n", VALUE); \
+ }
+
+ /* This is how to output an assembler line defining a `float' constant. */
+
+ #undef ASM_OUTPUT_FLOAT
+ #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
+ { \
+ if (REAL_VALUE_ISINF (VALUE)) \
+ fprintf (FILE, "\t.single 0r%s99e999\n", (VALUE) > 0 ? "" : "-"); \
+ else if (isnan (VALUE)) \
+ { \
+ union { float f; long l;} t; \
+ t.f = (VALUE); \
+ fprintf (FILE, "\t.long 0x%lx\n", t.l); \
+ } \
+ else \
+ fprintf (FILE, "\t.single 0r%.9g\n", VALUE); \
+ }
+
+ /* This is how to output an assembler lines defining floating operands.
+ There's no way to output a NaN's fraction, so we lose it. */
+
+ #undef ASM_OUTPUT_FLOAT_OPERAND
+ #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \
+ (REAL_VALUE_ISINF ((VALUE)) \
+ ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
+ : (VALUE) == -0.0 \
+ ? asm_fprintf (FILE, "%I0r-0.0") \
+ : asm_fprintf (FILE, "%I0r%.9g", (VALUE)))
+
+ #undef ASM_OUTPUT_DOUBLE_OPERAND
+ #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
+ (REAL_VALUE_ISINF ((VALUE)) \
+ ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
+ : (VALUE) == -0.0 \
+ ? asm_fprintf (FILE, "%I0r-0.0") \
+ : asm_fprintf (FILE, "%I0r%.17g", (VALUE)))
+
+ /* use A5 as framepointer instead of A6, this makes A6 available as a
+ * general purpose register, and can thus be used without problems in
+ * direct library calls. */
+ #undef FRAME_POINTER_REGNUM
+ #define FRAME_POINTER_REGNUM 13
+ #undef ARG_POINTER_REGNUM
+ #define ARG_POINTER_REGNUM 13
+
+ /* we use A4 for this, not A5, which is the framepointer */
+ #undef PIC_OFFSET_TABLE_REGNUM
+ #define PIC_OFFSET_TABLE_REGNUM 12
+
+ #define STANDARD_INCLUDE_DIR "gcc:include"
+ #define MD_STARTFILE_PREFIX "gcc:lib/"
+
+ /* we do have an ansi-complient c-library ;-) */
+ #define HAVE_ATEXIT
+ #define HAVE_VPRINTF
+ #define HAVE_VFPRINTF
+ #define HAVE_PUTENV
+ #define HAVE_STRERROR
+
+ #define ENVIRON_SEPARATOR ','
+
+ /* setup a default shell return value for those (gazillion..) programs that
+ (inspite of ANSI-C) declare main() to be void (or even VOID...) */
+
+ #define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
+
+ /* given that symbolic_operand(X), return TRUE if no special
+ base relative relocation is necessary */
+
+ #define LEGITIMATE_BASEREL_OPERAND_P(X) \
+ (flag_pic == 3 && read_only_operand (X))
+
+ #undef LEGITIMATE_PIC_OPERAND_P
+ #define LEGITIMATE_PIC_OPERAND_P(X) \
+ (! symbolic_operand (X, VOIDmode) || LEGITIMATE_BASEREL_OPERAND_P (X))
+
+
+ /* Define this macro if references to a symbol must be treated
+ differently depending on something about the variable or
+ function named by the symbol (such as what section it is in).
+
+ The macro definition, if any, is executed immediately after the
+ rtl for DECL or other node is created.
+ The value of the rtl will be a `mem' whose address is a
+ `symbol_ref'.
+
+ The usual thing for this macro to do is to a flag in the
+ `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
+ name string in the `symbol_ref' (if one bit is not enough
+ information).
+
+ On the Amiga we use this to indicate if a symbol is in text or
+ data space. */
+
+ #define ENCODE_SECTION_INFO(DECL)\
+ do \
+ { \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \
+ else \
+ { \
+ rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
+ ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
+ if (RTX_UNCHANGING_P (rtl) && !MEM_VOLATILE_P (rtl)) \
+ SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1; \
+ } \
+ } \
+ while (0)
+
+ #if 0
+ #undef SELECT_RTX_SECTION
+ #define SELECT_RTX_SECTION(MODE, X) \
+ { \
+ if (!flag_pic || LEGITIMATE_BASEREL_OPERAND_P (X)) \
+ readonly_data_section(); \
+ else if (LEGITIMATE_PIC_OPERAND_P (X)) \
+ readonly_data_section(); \
+ else \
+ data_section(); \
+ }
+ #else
+ #undef SELECT_RTX_SECTION
+ #define SELECT_RTX_SECTION(MODE, X) readonly_data_section ();
+ #endif
+
+ /* according to varasm.c, RELOC referrs *only* to whether constants (!)
+ are addressed by address. This doesn't matter in baserelative code,
+ so we allow (inspite of flag_pic) readonly_data_section() in that
+ case */
+
+ #undef SELECT_SECTION
+ #define SELECT_SECTION(DECL, RELOC) \
+ { \
+ if (TREE_CODE (DECL) == STRING_CST) \
+ { \
+ if (! flag_writable_strings) \
+ readonly_data_section (); \
+ else \
+ data_section (); \
+ } \
+ else if (TREE_CODE (DECL) == VAR_DECL) \
+ { \
+ if ((flag_pic && flag_pic != 3 && RELOC) \
+ || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \
+ data_section (); \
+ else \
+ readonly_data_section (); \
+ } \
+ else \
+ readonly_data_section (); \
+ }
+
+
+
+ /* starting support for amiga specific keywords (NOT CURRENTLY WORKING!)
+ * --------------------------------------------
+ */
+
+ /* validate attributes that don't take a parameter. Currently we support
+ * __attribute__ (saveds) and __attribute__ (interrupt)
+ */
+ #define HANDLE_ATTRIBUTE0(attr) \
+ (strcmp(attr, "saveds") != 0 && strcmp(attr, "interrupt") != 0)
+
+ /* (c-common.c)
+ * install additional attributes
+ */
+ #define HANDLE_EXTRA_ATTRIBUTES(a) \
+ if (TREE_VALUE (a) != 0 \
+ && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE \
+ && TREE_VALUE (a) == get_identifier ("saveds")) \
+ { \
+ if (TREE_CODE (decl) != FUNCTION_DECL) \
+ { \
+ warning_with_decl (decl, \
+ "saveds attribute specified for non-function `%s'"); \
+ return; \
+ } \
+ \
+ attr_do_saveds (DECL_NAME (decl)); \
+ } \
+ else if (TREE_VALUE (a) != 0 \
+ && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE \
+ && TREE_VALUE (a) == get_identifier ("interrupt")) \
+ { \
+ if (TREE_CODE (decl) != FUNCTION_DECL) \
+ { \
+ warning_with_decl (decl, \
+ "saveds attribute specified for non-function `%s'"); \
+ return; \
+ } \
+ \
+ attr_do_interrupt (DECL_NAME (decl)); \
+ } \
+
+
+ #define PROLOGUE_EXTRA_SAVE(mask) \
+ { extern char *current_function_name; \
+ /* saveds makes the function preserve d1/a0/a1 as well */ \
+ if (attr_does_saveds (current_function_name)) \
+ mask |= 0x40c0; } \
+
+
+ #define EPILOGUE_EXTRA_RESTORE(mask, nregs) \
+ { extern char *current_function_name; \
+ /* restore those extra registers */ \
+ if (attr_does_saveds (current_function_name)) \
+ { \
+ mask |= 0x0302; \
+ nregs += 3; \
+ } } \
+
+
+ #define EPILOGUE_EXTRA_BARRIER_KLUDGE(stream) \
+ { extern char *current_function_name; \
+ /* PLEASE Help! how is this done cleaner?? */ \
+ if (attr_does_saveds (current_function_name)) \
+ { \
+ fprintf (stderr, \
+ "warning: couldn't cleanup `saveds'-stack in `%s'.\n"); \
+ fprintf (stderr, \
+ " this is only ok, if the function never returns!\n"); \
+ } } \
+
+
+ #define EPILOGUE_EXTRA_TEST(stream) \
+ { extern char *current_function_name; \
+ /* with the interrupt-attribute, we have to set the cc before rts */ \
+ if (attr_does_interrupt (current_function_name)) \
+ asm_fprintf (stream, "\ttstl %s\n", reg_names[0]); } \
+
diff -2rcN dh5:gcc-2.1.orig/config/m68k.c gcc-2.1/config/m68k.c
*** dh5:gcc-2.1.orig/config/m68k.c Mon Apr 20 02:35:38 1992
--- gcc-2.1/config/m68k.c Sat Apr 18 21:58:21 1992
***************
*** 57,61 ****
finalize_pic ()
{
! if (flag_pic && current_function_uses_pic_offset_table)
emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
}
--- 57,61 ----
finalize_pic ()
{
! if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
}
***************
*** 205,209 ****
#endif
}
! if (flag_pic && current_function_uses_pic_offset_table)
{
#ifdef MOTOROLA
--- 208,212 ----
#endif
}
! if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
{
#ifdef MOTOROLA
***************
*** 795,804 ****
if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
{
if (reg == 0)
abort ();
! pic_ref = gen_rtx (MEM, Pmode,
! gen_rtx (PLUS, Pmode,
! pic_offset_table_rtx, orig));
current_function_uses_pic_offset_table = 1;
RTX_UNCHANGING_P (pic_ref) = 1;
--- 807,824 ----
if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
{
+ #ifdef LEGITIMATE_BASEREL_OPERAND_P
+ if (LEGITIMATE_BASEREL_OPERAND_P (orig))
+ return orig;
+ #endif
+
if (reg == 0)
abort ();
! if (flag_pic == 3)
! pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
! else
! pic_ref = gen_rtx (MEM, Pmode,
! gen_rtx (PLUS, Pmode,
! pic_offset_table_rtx, orig));
current_function_uses_pic_offset_table = 1;
RTX_UNCHANGING_P (pic_ref) = 1;
***************
*** 832,835 ****
--- 852,856 ----
/* Likewise, should we set special REG_NOTEs here? */
}
+
return pic_ref;
}
***************
*** 1884,1887 ****
--- 1905,1910 ----
if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
fprintf (file, ":l");
+ if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
+ fprintf (file, ":W");
}
fprintf (file, "(%s", reg_names[REGNO (breg)]);
***************
*** 1899,1902 ****
--- 1922,1927 ----
if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
fprintf (file, ":l");
+ if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
+ fprintf (file, ":W");
}
if (addr != 0 && ireg != 0)
diff -2rcN dh5:gcc-2.1.orig/config/m68k.h gcc-2.1/config/m68k.h
*** dh5:gcc-2.1.orig/config/m68k.h Mon Apr 20 02:35:41 1992
--- gcc-2.1/config/m68k.h Thu Apr 16 20:16:07 1992
***************
*** 327,333 ****
#define CONDITIONAL_REGISTER_USAGE \
! { \
! if (flag_pic) \
! fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
}
--- 327,336 ----
#define CONDITIONAL_REGISTER_USAGE \
! { \
! if (flag_pic) \
! fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
! /* prevent saving/restoring of the base reg */ \
! if (flag_pic == 3) \
! call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
}
diff -2rcN dh5:gcc-2.1.orig/config/m68k.md gcc-2.1/config/m68k.md
*** dh5:gcc-2.1.orig/config/m68k.md Mon Apr 20 02:35:51 1992
--- gcc-2.1/config/m68k.md Thu Apr 16 18:05:26 1992
***************
*** 705,715 ****
if (flag_pic && symbolic_operand (operands[1], SImode))
{
! /* The source is an address which requires PIC relocation.
! Call legitimize_pic_address with the source, mode, and a relocation
! register (a new pseudo, or the final destination if reload_in_progress
! is set). Then fall through normally */
! extern rtx legitimize_pic_address();
! rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
! operands[1] = legitimize_pic_address (operands[1], SImode, temp);
}
}")
--- 705,720 ----
if (flag_pic && symbolic_operand (operands[1], SImode))
{
! #ifdef LEGITIMATE_BASEREL_OPERAND_P
! if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
! #endif
! {
! /* The source is an address which requires PIC relocation.
! Call legitimize_pic_address with the source, mode, and a relocation
! register (a new pseudo, or the final destination if reload_in_progress
! is set). Then fall through normally */
! extern rtx legitimize_pic_address();
! rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
! operands[1] = legitimize_pic_address (operands[1], SImode, temp);
! }
}
}")
***************
*** 4588,4592 ****
"
{
! if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
force_reg (Pmode, XEXP (operands[0], 0)));
--- 4593,4597 ----
"
{
! if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
force_reg (Pmode, XEXP (operands[0], 0)));
***************
*** 4599,4603 ****
;; Operand 1 not really used on the m68000.
! "! flag_pic"
"*
#ifdef MOTOROLA
--- 4604,4608 ----
;; Operand 1 not really used on the m68000.
! "(! flag_pic || flag_pic == 3)"
"*
#ifdef MOTOROLA
***************
*** 4614,4618 ****
;; Operand 1 not really used on the m68000.
! "flag_pic"
"*
return \"jsr %0\";
--- 4619,4623 ----
;; Operand 1 not really used on the m68000.
! "(flag_pic && flag_pic < 3)"
"*
return \"jsr %0\";
***************
*** 4630,4634 ****
"
{
! if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
force_reg (Pmode, XEXP (operands[1], 0)));
--- 4635,4639 ----
"
{
! if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
force_reg (Pmode, XEXP (operands[1], 0)));
***************
*** 4641,4645 ****
(match_operand:SI 2 "general_operand" "g")))]
;; Operand 2 not really used on the m68000.
! "! flag_pic"
"*
#ifdef MOTOROLA
--- 4646,4650 ----
(match_operand:SI 2 "general_operand" "g")))]
;; Operand 2 not really used on the m68000.
! "(! flag_pic || flag_pic == 3)"
"*
#ifdef MOTOROLA
***************
*** 4656,4660 ****
(match_operand:SI 2 "general_operand" "g")))]
;; Operand 2 not really used on the m68000.
! "flag_pic"
"*
return \"jsr %1\";
--- 4661,4665 ----
(match_operand:SI 2 "general_operand" "g")))]
;; Operand 2 not really used on the m68000.
! "(flag_pic && flag_pic < 3)"
"*
return \"jsr %1\";
diff -2rcN dh5:gcc-2.1.orig/expr.c gcc-2.1/expr.c
*** dh5:gcc-2.1.orig/expr.c Mon Apr 20 02:40:47 1992
--- gcc-2.1/expr.c Thu Apr 16 21:14:25 1992
***************
*** 1699,1702 ****
--- 1699,1708 ----
argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
+ /* how would you do this RIGHT ?? fake a DECL node? dunno... */
+ #ifdef ENCODE_SECTION_INFO
+ /* mark it as a function (to be in the text section that is) */
+ SYMBOL_REF_FLAG (fun) = 1;
+ #endif
+
INIT_CUMULATIVE_ARGS (args_so_far, (tree)0, fun);
diff -2rcN dh5:gcc-2.1.orig/toplev.c gcc-2.1/toplev.c
*** dh5:gcc-2.1.orig/toplev.c Mon Apr 20 02:44:21 1992
--- gcc-2.1/toplev.c Thu Apr 16 21:34:22 1992
***************
*** 464,467 ****
--- 464,468 ----
{"pic", &flag_pic, 1},
{"PIC", &flag_pic, 2},
+ {"baserel", &flag_pic, 3},
{"common", &flag_no_common, 0},
{"inhibit-size-directive", &flag_inhibit_size_directive, 1},